﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxPage.aspx.cs" Inherits="AjaxPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function AjaxPage() {
            var self = this;
            self.txtFNameId = 'txtFName';
            self.txtLNameId = 'txtLName';

            this.CollectData = function () {
                alert('ajaxPage Data Collected');
            }
            this.SaveData = function () {
                alert('Save Data Called.');
                var fname = document.getElementById(self.txtFNameId).value;
                var lname = document.getElementById(self.txtLNameId).value;

                alert(fname + ' ' + lname + ' ajaxPage Data Saved');
            }
        }
        var myPage = new AjaxPage();
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type="text" id="txtFName" value=" " />
        <input type="text" id="txtLName" value=" " />
        <input type="button" name="btnSave" value="Click me" onclick="javascript:myPage.SaveData();" />
    </div>
    </form>
</body>
</html>
